import axios from 'axios';

export async function getServiceList(serviceName,serviceType,serviceDate,pageNo=1,pageSize=10){
    let resp = await axios.get('api/pet_sys/service.do',{
        params:{
            serviceName,
            serviceType,
            serviceDate,
            pageNo,
            pageSize
        }
    })
    return resp;
}

export async function deleteService(serviceId){
    let resp = await axios.get('api/pet_sys/service.do',{
        params:{
            method:'deleteService',
            serviceId
        }
    })
    return resp;
}

export async function addService(ruleForm){
    let resp = await axios.get('api/pet_sys/service.do',{
        params:{
            method:'addService',
            serviceName:ruleForm.serviceName,
            serviceType:ruleForm.serviceType,
            serviceDate:ruleForm.serviceDate,
            serviceWeightStandard:ruleForm.serviceWeightStandard,
            serviceStandard:ruleForm.serviceServiceStandard,
            serviceTime:ruleForm.serviceTime,
            serviceLevel:ruleForm.serviceLevel,
            servicePrice:ruleForm.servicePrice
        }
    })
    return resp;
}

export async function updateService(id,ruleForm){
    let resp = await axios.get('api/pet_sys/service.do',{
        params:{
            method:'updateService',
            serviceId:id,
            serviceName:ruleForm.serviceName,
            serviceType:ruleForm.serviceType,
            serviceDate:ruleForm.serviceDate,
            serviceWeightStandard:ruleForm.serviceWeightStandard,
            serviceStandard:ruleForm.serviceServiceStandard,
            serviceTime:ruleForm.serviceTime,
            serviceLevel:ruleForm.serviceLevel,
            servicePrice:ruleForm.servicePrice
        }
    })
    return resp;
}